#include <iostream>

using namespace std;

const int N = 1e6 + 10;

string s;
int n, pi[N];

int main()
{
	cin >> n >> s;
	s = ' ' + s;
	
	for(int i = 2; i <= n; i++)
	{
		int j = pi[i - 1];
		while(j && s[i] != s[j + 1]) j = pi[j];
		if(s[i] == s[j + 1]) j++;
		pi[i] = j; 
	} 
	
	cout << n - pi[n] << endl;
	
	return 0;
} 














